import request from '@/utils/request'

// 查询步骤信息列表
export function listStep(query) {
  return request({
    url: '/task/step/list',
    method: 'get',
    params: query
  })
}

// 查询步骤信息列表
export function getAll(query) {
  return request({
    url: '/task/step/getAll',
    method: 'get',
    params: query
  })
}

// 修改启用状态
export function changeStatus(stepId, status) {
  const data = {
    stepId,
    status
  }
  return request({
    url: '/task/step/changeStatus',
    method: 'post',
    data: data
  })
}

// 查询步骤信息详细
export function getStep(stepId) {
  return request({
    url: '/task/step/' + stepId,
    method: 'get'
  })
}

// 新增步骤信息
export function addStep(data) {
  return request({
    url: '/task/step',
    method: 'post',
    data: data
  })
}

// 修改步骤信息
export function updateStep(data) {
  return request({
    url: '/task/step',
    method: 'put',
    data: data
  })
}

// 删除步骤信息
export function delStep(stepId) {
  return request({
    url: '/task/step/' + stepId,
    method: 'delete'
  })
}
